home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 March: Reference Library / Dev.CD Mar 96 RL / Dev.CD Mar 96 RL.toast / Technical Documentation / develop / Preliminary Articles / Timing Code / Src / MicrosecondTrap.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-17  |  1.1 KB  |  51 lines  |  [TEXT/KAHL]

  1. /*                                    MicrosecondTrap.h                                */
  2. /*
  3.  * MicrosecondTrap.h
  4.  * Copyright © 1994 Apple Computer Inc.
  5.  */
  6. #ifndef __MicrosecondTrap__
  7. #define __MicrosecondTrap__
  8. #include <Types.h>
  9. #include <Traps.h>
  10.  
  11.  
  12. #ifndef __powercMin
  13. /*
  14.  * This trap returns the number of microseconds, but is not yet defined in all public
  15.  * headers. It is present on all systems that support the extended time manager..
  16.  */
  17. #ifndef _Microseconds
  18. #define _Microseconds    0xA193
  19. #pragma parameter Microseconds(__A1)
  20. pascal void Microseconds(UnsignedWide *microsecondCount) =
  21.   {0xA193,0x22C8,0x2280};
  22. #endif    /* _Microseconds */
  23. #endif    /* __powerc */
  24.  
  25.  
  26. /*
  27.  * TRUE if the Microsecond Trap is present.
  28.  */
  29. Boolean                        MicrosecondTrapPresent(void);
  30.  
  31. /*
  32.  * Convert a Microsecond value to a double-precision number of microseconds.
  33.  */
  34. double                        MicrosecondToDouble(
  35.         register const UnsignedWide    *epochPtr
  36.     );
  37.  
  38. /*
  39.  * Return the difference between two Microsecond Trap values.
  40.  * Integer subtraction is used to preserve accuracy.
  41.  */
  42. void
  43. MicrosecondDelta(
  44.         register const UnsignedWide    *startPtr,
  45.         register const UnsignedWide    *endPtr,
  46.         register UnsignedWide        *result
  47.     );
  48. #endif /* __MicrosecondTrap__ */
  49.  
  50.  
  51.